package com.ler.dubbo.demo.service.impl;

import com.alibaba.dubbo.config.annotation.Service;
import com.ler.dubbo.api.domain.User;
import com.ler.dubbo.api.service.UserService;

/**
 * @author lww
 * @date 2019-08-17 15:53
 */
@Service(timeout = 5000)
//@Component 可以使用Spring的@Component注解，来让Spring来管理。因为测试Dubbo不用这个注解
public class UserServiceImpl implements UserService {

	@Override
	public User getUser() {
		User user = new User();
		user.setName("Hello Dubbo!");
		user.setAge(123);
		try {
			Thread.sleep(4000);
		} catch (InterruptedException e) {
			e.printStackTrace();
		}
		return user;
	}

}
